package tencent;

import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * @author fly
 * @create 2021--04--18--21:10
 */
public class txun2 {
    public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int t=sc.nextInt();
    int[] a=new int[n];
        PriorityQueue<pair> q=new PriorityQueue<>(new Comparator<pair>() {
            @Override
            public int compare(pair o1, pair o2) {
                if(o1.time==o2.time)return o1.id- o2.id;
                return o1.time- o2.time;
            }
        });
        for(int i=0;i<n;i++){
            a[i]=sc.nextInt();
            q.offer(new pair(a[i],i+1));
        }
        while(t-->0){
            pair pa=q.poll();
            //ans[idx++]=pa.id;
            System.out.println(pa.id);
            q.offer(new pair(pa.time+a[pa.id-1],pa.id));
        }
    }
}
class pair{
    int time;
    int id;
    public pair(int time,int id){
        this.time=time;
        this.id=id;
    }
}
